//
//  LXCustom.m
//  INMOTION_CustomMadeProject
//
//  Created by wucw on 2021/6/25.
//  Copyright © 2021 cjg. All rights reserved.
//

#import "LXCustom.h"

@interface LXCustom ()

// 定制参数
@property (nonatomic, copy) NSDictionary *customDic;

@end

@implementation LXCustom


+ (instancetype)sharedCustom
{
    static LXCustom *custom = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        custom = [[LXCustom alloc] init];
        NSDictionary *customDic = [self getCustomDic];
        custom.needPassword = [[customDic objectForKey:@"Need password"] boolValue];
        custom.showOperationGuide = [[customDic objectForKey:@"Show operation guide"] boolValue];
        custom.showInstallVideo = [[customDic objectForKey:@"Show install video"] boolValue];
        custom.contact = [customDic objectForKey:@"Contact"];
        custom.contactCall = [customDic objectForKey:@"Contact Call"];
    });
    return custom;
}

+ (NSDictionary *)getCustomDic
{
    NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
    NSMutableDictionary *infoDic = [NSMutableDictionary dictionaryWithContentsOfFile:bundlePath];
    NSDictionary *customDic = [infoDic objectForKey:@"Custom parameters"];
    return customDic;
}

@end
